package com.googlecode.maratische.google;

import java.io.File;
import java.sql.SQLException;

import javax.swing.UIManager;

import org.apache.log4j.PropertyConfigurator;

/**
 * Hello world!
 * /reader/api/0/stream/contents/feed/http%3A%2F%2Flostfilm.tv%2Frssdd.xml?ot=1274256000&r=n&xt=user%2F05721618992712852750%2Fstate%2Fcom.google%2Fread&sharers=CMCm_saVBxCY1be70QoQ7vvd1HEQjbXwmIAFEObVqutpEPf6_r8REKvk07whENKU3vmXCBDPmaqavAQ&n=20&ck=1276849049868&client=scroll
 * /reader/atom/feed/http://lenta.ru/rss/news/internet/?output=json&xt=user%2F-%2F%2Fstate%2Fcom.google%2Fread
 * /reader/api/0/search/items/ids?q=a&s=feed%2Fhttp%3A%2F%2Flenta.ru%2Frss%2Fnews%2Finternet%2F&output=json
 */
public class App {
	
	public static void main(String[] args) {
		/*try {
	        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
	    } catch (Exception unused) {
	        ; // Ignore exception because we can't do anything.  Will use default.
	    }*/

	    
		MainController controller = MainController.getMainController();
		//init main config
		String fileName = controller.getPropertiesFileName();
		if (new File(fileName).exists()) {
			PropertyConfigurator.configure(fileName);
		}
		
		try {
			DaoAction.createDaoAction();
			controller.startMainFrame();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (SQLException e) {
			MainFrame mainFrame = new MainFrame(e);
			mainFrame.dispose();
		}
	}
			
}
